package com.freework.sys.dic.vo;

import com.freework.freedbm.cfg.annotation.TableCfg;
import com.freework.freedbm.dao.jdbcm.JdbcForDTO;
import com.freework.util.unmodifiableMap.KeysIndex;

public class PredefineTableCfg extends TableCfg {

	TableCfg cfg=null;
	int startMapIndex=0;
	KeysIndex keysIndex=null;
	public PredefineTableCfg(TableCfg cfg,int startMapIndex){
		this.cfg=cfg;
		this.startMapIndex=startMapIndex;
		JdbcForDTO[] fs=cfg.getFields();
		keysIndex=new KeysIndex();
		for (int i = startMapIndex; i < fs.length; i++) {
			keysIndex.setName(fs[i].getName());
		}
	}
	
	public int getStartMapIndex() {
		return startMapIndex;
	}

	public Class getDTOClass() {
		return cfg.getDTOClass();
	}

	public JdbcForDTO getField(java.lang.String name) {
		return cfg.getField(name);
	}

	public JdbcForDTO[] getFields() {
		return cfg.getFields();
	}

	public java.lang.String getInsertsql() {
		return cfg.getInsertsql();
	}

	public java.lang.String getInsertSQLKey() {
		return cfg.getInsertSQLKey();
	}

	public JdbcForDTO[] getPKey() {
		return cfg.getPKey();
	}

	public java.lang.String getQuerysql() {
		return cfg.getQuerysql();
	}

	public java.lang.String getTableName() {
		return cfg.getTableName();
	}

	public java.lang.String getUpdatesql() {
		return cfg.getUpdatesql();
	}

	public Object newInstance() {
		PredefineVO vo= (PredefineVO) cfg.newInstance();
		vo.setTableDataManager(this);
		return vo;
	}

	public java.lang.String toString() {
		return cfg.toString();
	}

	public KeysIndex getKeysIndex() {
		return keysIndex;
	}
	

}
